const sqlite3 = require('sqlite3');
const path    = require('path');


const db_name = path.join(__dirname, 'data.db');

const db = new sqlite3.Database(db_name, err => {
    if(err)
        console.log(err);
});

const create_sql = `
CREATE TABLE user(
    id INTEGER PRIMARY KEY,
    user_name VARCHAR(30) NOT NULL,
    age TINYINT(3) NOT NULL
)
`;

db.run(create_sql, err =>{
    if(err)
        console.log(err);
    else
        console.log("create successfully!");
});




